#ifndef _OPENCAS_CA_MODULE
#define _OPENCAS_CA_MODULE
#include "desctx.h"

#ifdef __cplusplus
extern "C" {
#endif


typedef struct _ca_module ca_module_t;
struct _ca_module {
  int  system_id;

  int  (*module_init)(void);
  void (*module_deinit)(void);

  void (*on_cat_arrived)(uint8_t *section);
  void (*on_pmt_arrived)(uint8_t *section);

  void (*on_ecm_arrived)(uint8_t *section, int types, short pid);
  void (*on_emm_arrived)(uint8_t *section);

  void (*get_emm_filter_match_mask)(uint8_t **match[], uint8_t **mask[], int *count);
};

/*
 * This symbol must be exported by ca module shared object(so).
 */
ca_module_t* ca_module_get(void);

#ifdef __cplusplus
}
#endif

#endif
